package GoFushan;

import java.util.Random;

public class Vehice extends AbstractVehicle{

	String name;
	
	public Vehice(String name) {
		this.name = name;
	}
	@Override
	public int speedUp() {
		if(name.equalsIgnoreCase("Plane")) {
			return Fast();
		} else if (name.equalsIgnoreCase("Train")) {
			return Mid();
		} else {
		    return Slow();
		}

	}
	
	public int Fast() {
		Random random = new Random();
		int[] s = {12,13,14,15};
		int speed = s[random.nextInt(4)];
		return speed;
	}
	
	public int Mid() {
		Random random = new Random();
		int[] s = {9,10,11};
		int speed = s[random.nextInt(3)];
		return speed;
	}
	
	public int Slow() {
		Random random = new Random();
		int[] s = {3,4,5,6,7,8};
		int speed = s[random.nextInt(6)];
		return speed;
	}

}
